package org.vison.wonfu.framework.test.admin.controller.req;

import lombok.Data;
import org.vison.framework.doc.annotation.ApiProperty;
import java.util.List;
import java.util.Map;

/**
 * 嵌套请求参数类
 * 包含多层嵌套结构，用于测试wonfu-doc的参数解析功能
 */
@Data
public class NestedRequest {
    
    /**
     * 请求头信息
     */
    @ApiProperty( description = "请求头信息", required = true)
    private RequestHeader header;
    
    /**
     * 请求体数据
     */
    @ApiProperty( description = "请求体数据", required = true)
    private RequestBody body;
    
    /**
     * 请求头信息类
     */
    @Data
    public static class RequestHeader {
        @ApiProperty( description = "请求唯一标识", required = true, example = "REQ-20231010-001")
        private String requestId;
        
        @ApiProperty( description = "请求时间戳", required = true, example = "1696924800000")
        private String timestamp;
        
        @ApiProperty( description = "接口版本号", required = true, example = "1.0.0")
        private String version;
        
        @ApiProperty( description = "客户端IP地址", example = "192.168.1.100")
        private String clientIp;
        
        @ApiProperty( description = "认证信息", required = true)
        private AuthInfo authInfo;
    }
    
    /**
     * 认证信息类
     */
    @Data
    public static class AuthInfo {
        @ApiProperty( description = "访问令牌", required = true, example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...")
        private String token;
        
        @ApiProperty( description = "用户ID", required = true, example = "USER-001")
        private String userId;
        
        @ApiProperty( description = "用户角色列表", example = "[\"admin\",\"user\"]")
        private List<String> roles;
    }
    
    /**
     * 请求体数据类
     */
    @Data
    public static class RequestBody {
        @ApiProperty( description = "请求名称", required = true, example = "测试请求")
        private String name;
        
        @ApiProperty( description = "请求描述", example = "这是一个测试嵌套参数的请求")
        private String description;
        
        @ApiProperty( description = "项目列表", example = "[{\"id\":\"item1\",\"value\":\"测试值\"}]")
        private List<Item> items;

        @ApiProperty( description = "配置信息", required = true)
        private Config config;
    }
    
    /**
     * 项目信息类
     */
    @Data
    public static class Item {
        @ApiProperty( description = "项目ID", required = true, example = "item-001")
        private String id;
        
        @ApiProperty( description = "项目值", required = true, example = "测试数据")
        private String value;

        @ApiProperty( description = "是否激活", required = true, example = "true")
        private boolean active;

    }
    

    
    /**
     * 配置信息类
     */
    @Data
    public static class Config {
        @ApiProperty( description = "是否启用配置", required = true, example = "true")
        private boolean enabled;
        
        @ApiProperty( description = "超时时间(毫秒)", required = true, example = "30000")
        private int timeout;


        @ApiProperty( description = "附加属性", example = "{\"key1\":\"value1\",\"key2\":\"value2\"}")
        private Map<String, String> attributes;
    }

}